// Test file for panic/recover error handling

func test_basic_recover() {
    println("Testing basic recover...")
    
    recover err {
        "error" -> {
            println("Caught error:", err)
            assert(err == "error","err should be 'error'")
        }
        _ -> {
            println("Caught unknown error:", err)
        }
    }
    
    panic("error")
    println("After panic (should not print)")
}

func test_wildcard_only() {
    println("Testing wildcard only recover...")
    
    recover err {
        _ -> {
            println("Caught all errors:", err)
        }
    }
    
    panic("some error")
    println("After panic (should not print)")
}

func test_recover_suite() {
    test_basic_recover()
    test_wildcard_only()
    println("All tests completed")
}
